package com.chen.utils;


import com.baomidou.mybatisplus.core.conditions.Wrapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.chen.common.PageParam;
import com.chen.common.PageResult;
import org.apache.ibatis.annotations.Param;

/**
 * ClassName: BaseMapperX
 * Package: com.chen.utils
 * Description:
 *
 * @Author 陈俊辉
 * @Create 2024/4/11 18:17
 * @Version 1.0
 */
public interface BaseMapperX <T> extends BaseMapper<T> {
   default  public PageResult<T> selectPage(PageParam pageParam, @Param("ew") Wrapper<T>queryWrapper){
      IPage<T> mpPage = new Page<T>(pageParam.getPage(),pageParam.getPageSize());
      selectPage(mpPage,queryWrapper);
      return new PageResult<T>(mpPage.getRecords(),mpPage.getTotal());
   }
}
